// All source files and native code may not be transmitted, reproduced, distributed, 
// or commercially exploited in any way without the express written consent of Sybex Inc.

//MOST THINGS THAT CHANGE

//CHAPTER TITLE
var TestChapter:String = "Chapter 4";

var user_Correct:Array = new Array("B","B","AD","A","AE","BD","C","AC","B","AC","A","D","B","B","C","A","B","B","C","D");

total = user_Correct.length;
_root.countdown = false;
// set to false to make the timer count up //
_root.hour = 0;
// number of hours at start//
_root.minute = 0;
// number of minutes at start//
//DON'T FORGET THE QUESTIONS AT THE END
//END OF MOST THINGS THAT CHANGE
//
//
//The following is used in the timer mc for adjusting the clock.
_root.delay = false;
_root.wait = 60;
//wait in seconds
_root.lastTime = Math.floor(getTimer()/1000);
i = 1;
totalCorrect = 0;
totalWrong = 0;
QCounter.QTotal.text = total;
Test_Title.text = TestChapter;
var finalCorrect:Number;
var userResponse:Array = new Array(total);
var markResponse:Array = new Array(total);
user_responseA = "";
user_responseB = "";
user_responseC = "";
user_responseD = "";
user_responseE = "";
user_responseF = "";
user_responseG = "";
user_responseH = "";
user_responseI = "";
user_responseJ = "";
user_responseK = "";
user_responseL = "";
user_responseM = "";
user_responseN = "";
_root.review = false;

function initialize() {
	_root.review = false;
	for (j=0; j<total; j++) {
		userResponse[j] = "";
		markResponse[j] = "";
	}
	
}

function showMatch() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;
}

// display multiple choice user_response answer function
function display() {
	set("user_response"+i, user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN);
	userResponse[i-1] = user_responseA+user_responseB+user_responseC+user_responseD+user_responseE+user_responseF+user_responseG+user_responseH+user_responseI+user_responseJ+user_responseK+user_responseL+user_responseM+user_responseN;

	//**NEW
	response.text = userResponse[i-1];
	
}

//radio button function
function answer(choice) {
	set("user_response"+i, choice);
	userResponse[i-1] = choice;
	
	//**NEW
	response.text = userResponse[i-1];	
}

// marker button fuction
function mark(choice) {
	_root["mark"+i] = choice;
	markResponse[i-1] = choice;
}

// display fill in the blank by user.
function submit(userInput) {
	_root["user_response"+i] = userInput;
}

function reset() {
	_root["user_response"+i] = "";
}

function UnloadReview() {
	//ReviewLinks.unloadMovie();
}


function LayoutQuestion() {

	qname = "q"+(_root._currentframe-1);
	
	markname = "m"+(_root._currentframe-1);
	
	_root.loadQuestion(_root._currentframe-1);	
	
	_root.createEmptyMovieClip("container", 1);

	_root.attachMovie("Marker_mc", markname, 2, {_x:65.4, _y:55.4});
	
	if (_root.question_type == "2R") { this.attachMovie("2R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3R") { this.attachMovie("3R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "3MC") { this.attachMovie("3MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4R") { this.attachMovie("4R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "4MC") { this.attachMovie("4MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5R") { this.attachMovie("5R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "5MC") { this.attachMovie("5MC", qname, 1, {_x:24, _y:165}); }	
	if (_root.question_type == "6R") { this.attachMovie("6R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "6MC") { this.attachMovie("6MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7R") { this.attachMovie("7R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "7MC") { this.attachMovie("7MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8R") { this.attachMovie("8R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "8MC") { this.attachMovie("8MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9R") { this.attachMovie("9R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "9MC") { this.attachMovie("9MC", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10R") { this.attachMovie("10R", qname, 1, {_x:24, _y:165}); }
	if (_root.question_type == "10MC") { this.attachMovie("10MC", qname, 1, {_x:24, _y:165}); }


	if (_root.review == false) { _root.attachMovie("show_answer", "show_answer1", 3, {_x:72, _y:418}); }
	if (_root.review == true)  { _root.attachMovie("show_review", "show_review1", 3, {_x:72, _y:418}); }
        if (_root.figure_flag == "True") { _root.attachMovie("show_figure", "show_figure1", 6, {_x:72, _y:418}); }
        if (_root.figure_flag == "False") { _root.createEmptyMovieClip("container", 6); }        

	question_scroll._visible = (question_text.maxscroll > 1);
	question_scroll.setSize(85,16); 
	
	//**NEW
	response.text = userResponse[i-1];
}

function loadQuestion(inNum:Number) {
	var cur:Number = inNum;
	//This corrects for the first frame holding all functions
	//QUESTIONS AND ANSWERS CAN ACCEPT HTML FORMATTING!!!
	//EACH QUESTION SHOULD BE FORMATTED SIMILAR TO THE FOLLOWING.

	switch (cur) {
case 1 :
_root.question = "What is the term defining the amount of times a cycle of an RF signal will oscillate in one second?";
_root.answerA = "Phase";
_root.answerB = "Frequency";
_root.answerC = "Amplitude";
_root.answerD = "Wavelength";
_root.correct = "B";
_root.explanation = "Frequency is the number of times in one second a signal will oscillate. Phase is a shift, amplitude is height, and wavelength is a distance of one cycle.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 2 :
_root.question = "How many non-overlapping channels are available in the unlicensed 2.4 GHz ISM band?";
_root.answerA = "1";
_root.answerB = "3";
_root.answerC = "6";
_root.answerD = "11";
_root.correct = "B";
_root.explanation = "There are three non-overlapping channels in the 2.4 GHz ISM band. Fourteen channels are available in this band. The locale will determine which channels can be used.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 3 :
_root.question = "The capacity of an access point is dependent upon which factors? (Choose two.)";
_root.answerA = "Number of users";
_root.answerB = "Channel reuse";
_root.answerC = "Co-location";
_root.answerD = "Software applications";
_root.answerE = "Frequency";
_root.correct = "AD";
_root.explanation = "The capacity of an access point is dependent upon the number of users and software applications in use. Too many users or too many bandwidth-intensive applications will affect the performance of an access point.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 4 :
_root.question = "When an RF signal passes between mediums of different densities and may change speeds and bend, the behavior is:";
_root.answerA = "Refraction";
_root.answerB = "Reflection";
_root.answerC = "Scattering";
_root.answerD = "Diffraction";
_root.correct = "A";
_root.explanation = "Refraction is when a signal will change speeds and bend when passing between mediums of different densities. Reflection bounces off a smooth surface, diffraction will pass around, and scattering bounces off an uneven surface.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 5 :
_root.question = "What two devices use RF to communicate? (Choose two.)";
_root.answerA = "Transmitter";
_root.answerB = "Transistor";
_root.answerC = "Reactor";
_root.answerD = "Reflector";
_root.answerE = "Receiver";
_root.correct = "AE";
_root.explanation = "RF communications require a transmitter and receiver. A transistor is an electronic component; a reactor does not exist in RF.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 6 :
_root.question = "Which are relative measures of RF power? (Choose two.)";
_root.answerA = "mW";
_root.answerB = "dB";
_root.answerC = "dBm";
_root.answerD = "dBi";
_root.answerE = "Watt";
_root.correct = "BD";
_root.explanation = "dB and dBi are relative measures of RF power. mW, dBm, and watt are absolute measures of RF power.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 7 :
_root.question = "In the 2.4 GHz range, what distance between the center frequencies (in megahertz) is required for two channels to be considered non-overlapping for HR/DSSS?";
_root.answerA = "5 MHz";
_root.answerB = "22 MHz";
_root.answerC = "25 MHz";
_root.answerD = "30 MHz";
_root.correct = "C";
_root.explanation = "25 MHz is required for channels to be considered non-overlapping. 22 MHz is the width of a DSSS channel in the 2.4 GHz band.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 8 :
_root.question = "Two characteristics of RF signals are:";
_root.answerA = "Amplitude";
_root.answerB = "Reflection";
_root.answerC = "Phase";
_root.answerD = "Refraction";
_root.answerE = "Diffraction";
_root.correct = "AC";
_root.explanation = "Amplitude and phase are two characteristics of RF signals. Reflection, refraction, and diffraction are behaviors of RF.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 9 :
_root.question = "How many channels are available for wireless LANs to use in the unlicensed UNII-1 band?";
_root.answerA = "2";
_root.answerB = "4";
_root.answerC = "6";
_root.answerD = "11";
_root.correct = "B";
_root.explanation = "UNII -1 band has four channels available for wireless LAN use. Eleven channels are available in UNII-2e.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 10 :
_root.question = "Which are absolute measures of RF power? (Choose two.)";
_root.answerA = "Watt";
_root.answerB = "dB";
_root.answerC = "mW";
_root.answerD = "dBi";
_root.answerE = "dBd";
_root.correct = "AC";
_root.explanation = "Watt and mW are absolute measures of RF power. dB, dBi, and dBd are relative measures.";
_root.figure_flag = "False";
_root.question_type = "5MC";
break;

case 11 :
_root.question = "Which two channels are considered non-overlapping in the 2.4 GHz band?";
_root.answerA = "1 and 6";
_root.answerB = "2 and 6";
_root.answerC = "6 and 10";
_root.answerD = "11 and 13";
_root.correct = "A";
_root.explanation = "Channels 1 and 6 are non-overlapping. There must be a separation of five channels (with the exception of channel 14) to be considered non-overlapping in the 2.4 GHz band.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 12 :
_root.question = "How many channels are available for wireless LAN use in the unlicensed 2.4 GHz ISM band?";
_root.answerA = "8";
_root.answerB = "10";
_root.answerC = "11";
_root.answerD = "14";
_root.correct = "D";
_root.explanation = "There are 14 channels available in the unlicensed 2.4 GHz ISM band. The channels used are determined by the locale.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 13 :
_root.question = "The range of a 2.4 GHz signal is mostly dependent on which RF characteristic?";
_root.answerA = "Frequency";
_root.answerB = "Wavelength";
_root.answerC = "Amplitude";
_root.answerD = "Phase";
_root.correct = "B";
_root.explanation = "The wavelength is the distance of an RF signal. Frequency is how many times it oscillates per second, amplitude is the height, and phase is a shift.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 14 :
_root.question = "Which item has an effect on RF line of sight?";
_root.answerA = "Phase";
_root.answerB = "Obstacles";
_root.answerC = "Interference";
_root.answerD = "Amplitude";
_root.correct = "B";
_root.explanation = "Obstacles affect the RF line of sight. Phase and amplitude are characteristics of radio frequency, and interference affects the throughput.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 15 :
_root.question = "How many channels are available for wireless LAN use in the unlicensed middle UNII-2e band?";
_root.answerA = "4";
_root.answerB = "6";
_root.answerC = "11";
_root.answerD = "14";
_root.correct = "C";
_root.explanation = "There are 11 channels available for wireless LAN use in the unlicensed UNII-2e band. The other three 5 GHz bands have only 4 channels each.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 16 :
_root.question = "The amplitude of an RF signal is:";
_root.answerA = "Height";
_root.answerB = "Length";
_root.answerC = "Shift";
_root.answerD = "Width";
_root.correct = "A";
_root.explanation = "The amplitude is the height of an RF signal. The length of one cycle is the wavelength, the shift is phase, and width is not a valid factor.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 17 :
_root.question = "An 802.11b channel is how wide in MHz?";
_root.answerA = "5 MHz";
_root.answerB = "22 MHz";
_root.answerC = "25 MHz";
_root.answerD = "30 MHz";
_root.correct = "B";
_root.explanation = "A 2.4 GHz 802.11b signal is 22 MHz wide. 25 MHz is the distance required to be considered non-overlapping.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 18 :
_root.question = "When an RF signal bounces off a smooth non-absorptive surface, the behavior is:";
_root.answerA = "Refraction";
_root.answerB = "Reflection";
_root.answerC = "Scattering";
_root.answerD = "Diffraction";
_root.correct = "B";
_root.explanation = "An RF signal that bounces off a smooth surface is reflection. Refraction passes through, diffraction bends around, and scattering bounces off a non-smooth surface.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 19 :
_root.question = "What is the gain of an antenna measured in?";
_root.answerA = "dB";
_root.answerB = "dBc";
_root.answerC = "dBi";
_root.answerD = "dBm";
_root.correct = "C";
_root.explanation = "The gain of an antenna is measured in dBi. This is a relative measure of power.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

case 20 :
_root.question = "When RF passes or bends around an obstacle such as a building or column, the behavior is:";
_root.answerA = "Reflection";
_root.answerB = "Refraction";
_root.answerC = "Scattering";
_root.answerD = "Diffraction";
_root.correct = "D";
_root.explanation = "Diffraction passes or bends around an obstacle. Reflection bounces off a smooth surface, refraction passes through, and scattering bounces off an uneven surface.";
_root.figure_flag = "False";
_root.question_type = "4R";
break;

	}
		
	QCounter.QCurrent.text = cur;
}

initialize();


//Change the following question numbers to the indicated question type!
//1. 4R
//2. 4R
//3. 5MC
//4. 4R
//5. 5MC
//6. 5MC
//7. 4R
//8. 5MC
//9. 4R
//10. 5MC
//11. 4R
//12. 4R
//13. 4R
//14. 4R
//15. 4R
//16. 4R
//17. 4R
//18. 4R
//19. 4R
//20. 4R





//